package com.yue.pattern.singleton;

/**
 * Created by qiuyang on 06/04/2017.
 */
public class Singleton {
    private static Singleton singleton;

    private Singleton() {}

    private static class SingletonInner{
        public static Singleton get() {
            if (singleton == null) {
                singleton = new Singleton();
            }
            return singleton;
        }
    }

    public Singleton getInstance() {
        return SingletonInner.get();
    }
}
